


#ifndef PF_DIMRADIAL_H
#define PF_DIMRADIAL_H

#include "pf_dimension.h"
#include "lx_Export.h"
/**
 * Holds the data that defines a radial dimension entity.
 */
class LX_EXPORT PF_DimRadialAttribute {
public:
    /**
     * Default constructor. Leaves the data object uninitialized.
     */
    PF_DimRadialAttribute() {}

    /**
     * Constructor with initialisation.
     *
     * @param definitionPoint Definition point of the radial dimension. 
     * @param leader Leader length.
     */
    PF_DimRadialAttribute(const PF_Vector& definitionPoint,
                     double leader) {
        this->definitionPoint = definitionPoint;
        this->leader = leader;
    }

    friend class PF_DimRadial;
    //friend class PF_ActionDimRadial;

    friend std::ostream& operator << (std::ostream& os,
                                      const PF_DimRadialAttribute& dd) {
        os << "(" << dd.definitionPoint << "/" << dd.leader << ")";
        return os;
    }

public:
    /** Definition point. */
    PF_Vector definitionPoint;
    /** Leader length. */
    double leader;
};



/**
 * Class for radial dimension entities.
 *

 */
class LX_EXPORT PF_DimRadial : public PF_Dimension {
public:
    PF_DimRadial(PF_Container* parent,
                 const PF_DimensionAttribute& d,
                 const PF_DimRadialAttribute& ed);
    virtual ~PF_DimRadial() {}

    virtual PF_Entity* clone() {
        PF_DimRadial* d = new PF_DimRadial(*this);
        d->setOwner(isOwner());
        d->initId();
        d->detach();
        return d;
    }

    /**	@return LX_Define::EntityDimRadial */
    virtual LX_Define::EntityType rtti() const {
        return LX_Define::EntityDimRadial;
    }

    /**
     * @return Copy of data that defines the radial dimension. 
     * @see getData()
     */
    PF_DimRadialAttribute getEData() const {
        return edata;
    }
	
    virtual PF_VectorSolutions getRefPoints();

    virtual QString getMeasuredLabel();

    virtual void update(bool autoText=false);

    PF_Vector getDefinitionPoint() {
        return edata.definitionPoint;
    }
    double getLeader() {
        return edata.leader;
    }

    virtual void move(PF_Vector offset);
    virtual void rotate(PF_Vector center, double angle);
    virtual void scale(PF_Vector center, PF_Vector factor);
    virtual void mirror(PF_Vector axisPoint1, PF_Vector axisPoint2);
	virtual void moveRef(const PF_Vector& ref, const PF_Vector& offset);

    friend std::ostream& operator << (std::ostream& os,
                                      const PF_DimRadial& d);

protected:
    /** Extended data. */
    PF_DimRadialAttribute edata;
};

#endif
